﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="@Url.Content("~/favicon.ico")" />

    <title>@(ViewBag.Title != null ? (ViewBag.Title + " - ") : "")tippelde.net</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")

</head>
<body>
    <div class="navbar navbar-customized navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @Html.ActionLink("tippelde.net", "Index", "Home", null, new { @class = "navbar-brand" })
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    @if (User.Identity.IsAuthenticated)
                    {
                        <li class="dropdown">
                            <a href="#" class="dropdown" data-toggle="dropdown">Hírek <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li>@Html.ActionLink("Minden hír", "Index", "News")</li>
                                <li class="divider"></li>
                                @foreach (var g in Tippelde.Web.Helpers.CacheManager.Current.GetGroupsForUser())
                                {
                                    <li><a href="@Url.Action("Group", "News", new { Id=g.Id})">@g.Name</a></li>
                                }
                            </ul>
                        </li>
                    }
                    else
                    {
                        <li>@Html.ActionLink("Hírek", "Index", "News")</li>
                    }
                    @if (User.Identity.IsAuthenticated)
                    {
                        <li class="dropdown">
                            <a href="#" class="dropdown" data-toggle="dropdown">Események <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                <li>@Html.ActionLink("Minden esemény", "Index", "Event")</li>
                                <li class="divider"></li>
                                @foreach (var g in Tippelde.Web.Helpers.CacheManager.Current.GetGroupsForUser())
                                {
                                    <li><a href="@Url.Action("Group", "Event", new { Id=g.Id})">@g.Name</a></li>
                                }
                            </ul>
                        </li>
                        <li class="dropdown">
                            <a href="#" class="dropdown" data-toggle="dropdown">Tabellák <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                @foreach (var g in Tippelde.Web.Helpers.CacheManager.Current.GetGroupsForUser())
                                {
                                    <li><a href="@Url.Action("Index", "Bet", new { Id=g.Id})">@g.Name</a></li>
                                }
                            </ul>
                        </li>
                    }
                    @if (User.IsInRole("admin") || User.IsInRole("teammanager"))
                    {
                        <li>@Html.ActionLink("Csapatok", "Index", "Team")</li>
                    }
                    @if (User.IsInRole("admin"))
                    {
                        <li>@Html.ActionLink("Csoportok", "Index", "Group")</li>
                        <li>@Html.ActionLink("Felhasználók", "Index", "User")</li>
                    }
                </ul>
                @Html.Partial("_LoginPartial")
            </div>
        </div>
    </div>
    <div class="container body-content">
        @RenderBody()
    </div>
    <hr />
    <footer>
        <div class="container">&copy; @DateTime.Now.Year - NPeete</div>
        <div id="loginModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modalTitle" aria-hidden="true"></div>
    </footer>
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/jqueryui")
    @Scripts.Render("~/bundles/bootstrap")
    @Scripts.Render("~/bundles/tippelde-global")
    @RenderSection("scripts", required: false)
</body>
</html>
